<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container">
    <form th:action="@{/kinds/save}" th:object="${kind}" method="POST">

        <input type="hidden" th:field="${kind.kindId}">
        <div class="logo"></div>
        商品名称：<select multiple="multiple" th:field="*{commodities}">

                    <option th:each="commodity : ${allCommodities}" th:value="${commodity.commodityId}" th:text="${commodity.name}"></option>
<!--                    <span th:if="${#fields.hasErrors('name')}" th:errors="${commodity.name}"></span>-->
                </select>
        <label for="type">类型:</label>
        <input type="text" id="type" th:field="${kind.type}">
        <span th:if="${#fields.hasErrors('type')}" th:errors="${kind.type}"></span>
        <label for="description">输入商品描述:</label>
        <input type="text" id="description" th:field="${kind.description}">
        <span th:if="${#fields.hasErrors('description')}" th:errors="${kind.description}"></span>


        <button type="submit">新增商品类型</button>
    </form>
</div>
</body>
</html>